import { createSlice } from "@reduxjs/toolkit";
const data = createSlice({
  name: "data",
  initialState: {
    homePageP_id: "",
    rankingPageP_id: "",
    Candidate_ids: [],
    userInfo:null
  },
  reducers: {
    setHomePageP_id(state, action) {
      state.homePageP_id = action.payload;
    },
    setRankingPageP_id(state, action) {
      state.rankingPageP_id = action.payload;
    },
    getCandidate_ids(state, { payload }) {
      state.Candidate_ids = payload;
    },
    setUserInfo(state, { payload }) {
      state.userInfo = payload;
    }
  },
});
export const { setHomePageP_id, setRankingPageP_id, getCandidate_ids,setUserInfo } =
  data.actions;
export default data;
